package text;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Text {
    public static void main(String[] args) {
        ArrayList<Integer> list =new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        List<Integer> list1 =list.subList(2,4);
        System.out.println(list);
        System.out.println(list1);
        System.out.println("改变之后");
        list1.set(0,99);
        System.out.println(list);
        System.out.println(list1);
    }
    public static void main1(String[] args) {
        ArrayList<String> list1 =new ArrayList<>();
        list1.add("Java");
        System.out.println(list1);
        ArrayList<String> list2 =new ArrayList<>(10);
        list2.add("Java SE");
        list2.addAll(list1);
        System.out.println(list2);
        ArrayList<String> list3 =new ArrayList<>(list2);
        list3.add("Java EE");
        System.out.println(list3);
        System.out.println(list3.contains("Java E"));
        list3.set(1,"JAVA");
        System.out.println(list3);
        list3.add(1,"Java");

        System.out.println(list3.size());
        System.out.println(list3);
        list3.remove("JAVA");
        System.out.println(list3);
        list3.remove(1);
        System.out.println(list3);
        list3.clear();
        System.out.println(list3);
    }
}
